package cn.ssm.test.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.ssm.test.dao.IUserDao;
import cn.ssm.test.model.User;    
    
@Service("userService")    
public class UserServiceImpl implements IUserService {    
    @Resource    
    private IUserDao userDao;    
        
    public User getUserById(int userId) {    
        return userDao.queryByPrimaryKey(userId);    
    }    
    
    public void insertUser(User user) {    
        userDao.insertUser(user);    
    }    
    
    public void addUser(User user) {    
        userDao.insertUser(user);    
    }    
    
    @Override    
    public List<User> getAllUser() {    
        return userDao.getAllUser();    
    }

	@Override
	public User getUserByAccount(String username) {
		 return userDao.getUserByAccount(username); 
	}    
    
}    